<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

<?php
$server="localhost";
$name="root";
$pwd="123456";
$db="bahar";

$con=mysqli_connect($server,$name,$pwd,$db);
if ($con) {
    $id = $_GET['id'];
    $sql = "select * from bahar where id=" . $id;
    $run = mysqli_query($con, $sql);
    if ($run && mysqli_num_rows($run) > 0) {
        $kur = mysqli_fetch_assoc($run);
    }

} else {
    echo "未连接数据库，错误内容：" . mysqli_connect_error();
}

?>





<form action="baharm.php"method="post">
    <input type="hidden" name"id" value="<? echo  $id??'0'?>">
    姓名：<input type="text" name="name" value="<echo $kur['name']?>">
    年龄：<input tayp="text" name="age" value="<echo $kur['age']?>">
    地址：<input type="text" name="ads" value="<echo $kur['ads']?>">
    <input type="submit">



</form>
</body>
</html>